![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
true-case-path
Advanced tools
Package description
The true-case-path npm package is designed to provide the true case of a filesystem path on a case-insensitive filesystem. This is particularly useful when working with file systems that do not enforce case sensitivity, such as those on Windows and macOS. It helps in ensuring that the path casing matches the actual casing on the filesystem.
Get true case of a file path
This feature allows you to get the true case of a file path. It returns a promise that resolves to the correctly cased path as a string. If the file does not exist, the promise is rejected with an error.
const trueCasePath = require('true-case-path');
trueCasePath('/users/guest/documents/myfile.txt').then((trueCasePath) => {
console.log(trueCasePath);
}).catch((error) => {
console.error(error);
});
This is a Webpack plugin that enforces the entire path of all required modules to match the exact case of the actual path on disk. It is useful for avoiding module resolution issues on case-sensitive file systems or when working across different operating systems. It is similar to true-case-path in that it deals with case sensitivity issues, but it is specifically tailored for Webpack and module resolution rather than general file path usage.
The normalize-path package is used to normalize file paths, ensuring they have consistent slashes and do not include redundant segments. While it does not provide the true case of a path, it is related in the sense that it also deals with file path manipulation and normalization.
This package provides utilities for converting a string to various case formats, including path case. It does not check the file system for the true case of a path, but it can be used to manipulate strings to have a consistent case format, which can be useful in file path operations.
Readme
trueCasePathSync(<fileSystemPath>)
Given a possibly case-variant version of an existing filesystem path, returns the case-exact, normalized version as stored in the filesystem.
If the input path is a globbing pattern as defined by the 'glob' npm package, only the 1st match, if any, is returned. Only a literal input path guarantees an unambiguous result.
If no matching path exists, undefined is returned. On case-SENSITIVE filesystems, a match will also be found, but if case variations of a given path exist, it is undefined which match is returned.
Windows, OSX, and Linux (though note the limitations with case-insensitive filesystems).
'./'
are acceptable, but paths starting with '../'
are not - when in doubt, resolve with fs.realPathSync()
first.
An initial '.'
and interior '..'
instances are normalized, but a relative
input path still results in a relative output path. If you want to ensure
an absolute output path, apply fs.realPathSync()
to the result.const trueCasePathSync = require('true-case-path')
trueCasePathSync('/users/guest') // OSX: -> '/Users/Guest'
trueCasePathSync('c:\\users\\all users') // Windows: -> 'c:\Users\All Users'
The code for this project was sourced from http://stackoverflow.com/a/33139702/45375
FAQs
Given a possibly case-variant version of an existing filesystem path, returns the case-exact, normalized version as stored in the filesystem.
The npm package true-case-path receives a total of 1,782,220 weekly downloads. As such, true-case-path popularity was classified as popular.
We found that true-case-path demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.